//
//  MyUtil.m
//  TestMultiMedia
//
//  Created by gaokunpeng on 15/6/27.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//

#import "MyUtil.h"

@implementation MyUtil

+(UIButton *)createBtnFrame:(CGRect)frame title:(NSString *)title target:(id)target action:(SEL)action
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = frame;
    [btn setTitle:title forState:UIControlStateNormal];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return btn;
    
}

+(UITextField *)createTextField:(CGRect)frame placeHolder:(NSString *)placeHolder
{
    UITextField *textField = [[UITextField alloc] initWithFrame:frame];
    textField.borderStyle = UITextBorderStyleRoundedRect;
    textField.placeholder = placeHolder;
    return textField;
}
+(UIImageView *)createImageView:(CGRect)frame imageName:(NSString *)imageName
{
    UIImageView *imageView =[[UIImageView alloc]initWithFrame:frame];
    if (imageName) {
        imageView.image =[UIImage imageNamed:imageName];
    }
    
    return imageView;
}
+(UILabel *)createLabel:(CGRect)frame text:(NSString *)text
{
    UILabel *label =[[UILabel alloc]initWithFrame:frame];
    label.text =text;
    label.font =[UIFont systemFontOfSize:15];
    return label;
}
@end
